home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / images / vgapalet.c < prev   
Encoding:
C/C++ Source or Header  |  1994-10-25  |  1.3 KB  |  50 lines

  1. /************************************************/
  2. /*                         */
  3. /*          SuperVGA BGI driver defines        */
  4. /*        Copyright (c) 1991        */
  5. /*        Jordan Hargraphix Software        */
  6. /*                        */
  7. /************************************************/
  8.  
  9. #include <dos.h>
  10. #include "svga256.h"
  11.  
  12.  
  13. /* Getvgapalette256 gets the entire 256 color palette */
  14. /* PalBuf contains RGB values for all 256 colors      */
  15. /* R,G,B values range from 0 to 63                  */
  16. /* Usage:                          */
  17. /*  DacPalette256 dac256;                  */
  18. /*                              */
  19. /* getvgapalette256(&dac256);                  */
  20. void getvgapalette256(DacPalette256 *PalBuf)
  21. {
  22.   struct REGPACK reg;
  23.  
  24.   reg.r_ax = 0x1017;
  25.   reg.r_bx = 0;
  26.   reg.r_cx = 256;
  27.   reg.r_es = FP_SEG(PalBuf);
  28.   reg.r_dx = FP_OFF(PalBuf);
  29.   intr(0x10,®);
  30. }
  31.  
  32. /* Setvgapalette256 sets the entire 256 color palette */
  33. /* PalBuf contains RGB values for all 256 colors      */
  34. /* R,G,B values range from 0 to 63                  */
  35. /* Usage:                          */
  36. /*  DacPalette256 dac256;                  */
  37. /*                              */
  38. /* setvgapalette256(&dac256);                  */
  39. void setvgapalette256(DacPalette256 *PalBuf)
  40. {
  41.   struct REGPACK reg;
  42.  
  43.   reg.r_ax = 0x1012;
  44.   reg.r_bx = 0;
  45.   reg.r_cx = 256;
  46.   reg.r_es = FP_SEG(PalBuf);
  47.   reg.r_dx = FP_OFF(PalBuf);
  48.   intr(0x10,®);
  49. }
  50.